/* 销售机会表单页面专用样式 */

/* ==================== 表单容器 ==================== */
.form-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.opportunity-form {
    padding: 24px;
}

/* ==================== 步骤指示器 ==================== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d1d1d6;
    color: #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #007AFF;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.step.completed .step-number {
    background: #30d158;
    color: #ffffff;
}

.step-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-title {
    color: #007AFF;
    font-weight: 600;
}

.step.completed .step-title {
    color: #30d158;
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #d1d1d6;
    margin: 0 20px;
    position: relative;
    top: -20px;
}

/* ==================== 表单步骤 ==================== */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 24px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f2f2f7;
}

.subsection {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007AFF;
}

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 16px 0;
}

/* ==================== 表单元素 ==================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label.required::after {
    content: '*';
    color: #ff3b30;
    font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #1d1d1f;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #8e8e93;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-hint {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ==================== 输入组件 ==================== */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-prefix,
.input-suffix {
    padding: 12px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-right: 1px solid #d1d1d6;
}

.input-suffix {
    border-right: none;
    border-left: 1px solid #d1d1d6;
}

.input-group .form-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.input-group .form-input:focus {
    box-shadow: none;
}

/* ==================== 特殊组件 ==================== */
.customer-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.customer-selector .form-input {
    flex: 1;
}

.selected-customers {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-customer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.selected-customer .remove-btn {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-separator {
    color: #666;
    font-weight: 500;
}

.budget-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-separator {
    color: #666;
    font-weight: 500;
}

/* ==================== 需求标签 ==================== */
.requirement-tags {
    margin-top: 20px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tag-checkbox input[type="checkbox"] {
    display: none;
}

.tag {
    padding: 8px 16px;
    border: 2px solid #d1d1d6;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #ffffff;
    transition: all 0.3s ease;
}

.tag-checkbox input[type="checkbox"]:checked + .tag {
    background: #007AFF;
    color: #ffffff;
    border-color: #007AFF;
}

.tag:hover {
    border-color: #007AFF;
    color: #007AFF;
}

.tag-checkbox input[type="checkbox"]:checked + .tag:hover {
    color: #ffffff;
}

/* ==================== 决策因素评估 ==================== */
.decision-factors {
    margin-top: 16px;
}

.factor-grid {
    display: grid;
    gap: 16px;
}

.factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e5ea;
}

.factor-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.rating-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.factor-range {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #d1d1d6;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.factor-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.factor-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.rating-value {
    font-size: 14px;
    font-weight: 600;
    color: #007AFF;
    min-width: 16px;
    text-align: center;
}

/* ==================== 单选和多选 ==================== */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #007AFF;
}

.radio-text {
    font-size: 14px;
    color: #333;
}

.competitor-details {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ff9500;
}

/* ==================== 提醒设置 ==================== */
.reminder-settings {
    margin-top: 20px;
}

.reminder-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007AFF;
}

.checkbox-text {
    font-size: 14px;
    color: #333;
}

/* ==================== 表单导航 ==================== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f2f2f7;
}

#prev-step-btn {
    background: #f2f2f7;
    color: #666;
    border: 1px solid #d1d1d6;
}

#prev-step-btn:hover {
    background: #e5e5ea;
}

/* ==================== 客户选择模态框 ==================== */
.customer-search-section {
    margin-bottom: 20px;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group .fas {
    position: absolute;
    left: 12px;
    color: #8e8e93;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    font-size: 14px;
    background: #f2f2f7;
}

.search-input:focus {
    outline: none;
    border-color: #007AFF;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.customer-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    background: #ffffff;
}

.customer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f2f2f7;
    cursor: pointer;
    transition: background 0.3s ease;
}

.customer-item:last-child {
    border-bottom: none;
}

.customer-item:hover {
    background: #f8f9fa;
}

.customer-item .customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007AFF;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.customer-item .customer-info {
    flex: 1;
}

.customer-item .customer-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.customer-item .customer-phone {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.customer-tags {
    display: flex;
    gap: 6px;
}

.customer-tags .tag {
    padding: 2px 6px;
    font-size: 10px;
    border: none;
}

.tag.tag-vip {
    background: #ff9500;
    color: #ffffff;
}

.tag.tag-active {
    background: #30d158;
    color: #ffffff;
}

.tag.tag-potential {
    background: #007AFF;
    color: #ffffff;
}

.tag.tag-normal {
    background: #8e8e93;
    color: #ffffff;
}

.select-customer-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 60px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .step-indicator {
        padding: 16px;
    }
    
    .step-line {
        margin: 0 10px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .step-title {
        font-size: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .date-range,
    .budget-range {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .reminder-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .tag-group {
        gap: 8px;
    }
    
    .tag {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .customer-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .opportunity-form {
        padding: 16px;
    }
    
    .step-indicator {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .step-line {
        display: none;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .subsection {
        padding: 12px;
    }
    
    .subsection-title {
        font-size: 14px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
    }
    
    .input-prefix,
    .input-suffix {
        padding: 10px;
    }
    
    .factor-item {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .rating-input {
        justify-content: space-between;
    }
    
    .factor-range {
        width: 100px;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-navigation .btn {
        width: 100%;
        justify-content: center;
    }
    
    .customer-item {
        padding: 12px;
    }
    
    .customer-item .customer-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}